package org.creavi.engine.hud;

import org.creavi.engine.hud.builder.HudInstanceBuilder;

public class HudInstanceFactory {
	private HudInstanceBuilder builder;

	public HudInstanceBuilder getBuilder() {
		return builder;
	}

	public void setBuilder(HudInstanceBuilder builder) {
		this.builder = builder;
	}
	
	public HudInstance createHudInstance(String skeleton, String instanceName) {
		HudDefinition hudDefinition = HudDefinitionFactory.getInstance().getHudDefinition(skeleton);
		
		builder.createNewHudInstance(instanceName, hudDefinition);
		builder.buildBasicHud(hudDefinition);
		builder.enhanceHud(hudDefinition);
		
		return builder.getHudInstance();
	}
}
